package order.utils;

import java.sql.Connection;
import java.sql.DriverManager;

public class DbUtil {

    public Connection getCon() throws Exception {
        Class.forName(PropertiesUtil.getValue("jdbcName"));
        Connection con = DriverManager.getConnection(PropertiesUtil.getValue("dbUrl"), PropertiesUtil.getValue("dbUserName"), PropertiesUtil.getValue("dbPassword"));

        con.toString();
        return con;
    }

    public void closeCon(Connection con) throws Exception {
        if(con!=null) {
            con.close();
        }
    }

    public static void main(String[] args) {
        DbUtil dbUtil = new DbUtil();
        try {
            dbUtil.getCon();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            System.out.println("no");

        }
    }
}
